<template>
  <div>
    <el-table :data="tableData" style="width: 60%">
      <el-table-column label="考试时间" width="180">
        <template slot-scope="scope">
          <i class="el-icon-time"></i>
          <span style="margin-left: 10px">{{ scope.row.time }}</span>
        </template>
      </el-table-column>
      <el-table-column label="考试名称" width="180" prop="name">
      </el-table-column>
      <el-table-column label="分数" prop="score"> </el-table-column>
      <el-table-column label="状态" prop="type">
        <template slot-scope="scope">
          <el-tag type="danger" v-if="scope.row.type == '未通过'" size="medium"
            >未通过</el-tag>
          <el-tag v-else size="medium">已通过</el-tag>
        </template>
      </el-table-column>
    </el-table>
  </div>
</template>

<script>
import { get_CET } from "@/api/sys.user.js";
import util from "@/libs/util.js";
export default {
  data() {
    return {
      tableData: [],
      loading: false
    };
  },
  methods: {
    get_CET1() {
      this.loading = true;
      get_CET({
        cookie: util.cookies.get("JSESSIONID")
      }).then(res => {
        if (res.statusCode == 200) {
          console.log(res);
          this.tableData = res.data.CTE4_arr;
          if (this.tableData.length == 1 && this.tableData[0].name == "") {
            this.tableData = [];
          }
        } else {
          this.$message.error(res.msg);
        }

        this.loading = false;
      });
    }
  },
  created() {
    this.get_CET1();
  }
};
</script>

<style></style>
